package com.example.sdemo.api.controller;

import com.example.sdemo.domain.entity.User;
import com.example.sdemo.app.service.ICustomerService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/study")
public class StudyController {

    @Resource
    public ICustomerService iCustomerService;

    @GetMapping("/getId/{id}")
    public String getValues(@PathVariable Integer id){
        return String.valueOf(id*2);
    };

    @PostMapping("/getVal")
    public String getValues(@RequestBody User user)  {
        return user.getName()+","+user.getSex()+"性,"+user.getAge()+"周岁";
    };

    @PutMapping("/getVal2")
    public String getValues2(@RequestBody User user)  {
        return user.toString();
    };

    @DeleteMapping("/deleteVal")
    public String delValue(@RequestBody User user)  {
        return user.getName()+"信息已删除";
    };

}
